<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Product
 *
 * @author Windy
 */
interface Product_Models_Interfaces_Product {
    /**
     * Get Product by primary key
     * @param int $id
     */
    public function getById($id);
    /**
     * Get all products
     */
    public function getAll();

     /**
     * Search for products by collection of conditions
     *
     * @param int $offset
     * @param int $count
     * @param array $exp Searching conditions. An array contain various conditions, keys including:
     * - product_id
     * - category_id
     * - created_user_id
     * - status
     * - keyword
     * @return Tomato_Model_RecordSet
     */
    public function find($offset, $count, $exp = null);

    /**
     * Count the number of products by collection of conditions
     *
     * @param array $exp Searching conditions (@see find)
     * @return int
     */
    public function count($exp = null);
    /**
     * Insert a new product
     * @param array $params
     */
    public function add($params);
    /**
     * Update a product
     * @param array $params
     */
    public function edit($params);
    /**
     * Delete a product
     * @param int $id
     */
    public function delete($id);

    /**
	 * Get translable items which haven't been translated of the default language
	 *
	 * @since 2.0.8
	 * @param string $lang
	 * @param int $count
	 * @return Tomato_Model_RecordSet
	 */
	public function getTranslatable($lang, $count);

	/**
	 * Get translation item which was translated to given category
	 *
	 * @since 2.0.8
	 * @param News_Models_Article $product
	 * @return News_Models_Article
	 */
	public function getSource($product);
}
?>
